package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Notice entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_NOTICE", schema = "HCD_DEV")
public class Notice extends Entity implements java.io.Serializable {

	// Fields

	private Long noticeId;
	private Integer type;
	private String title;
	private String summary;
	private String content;
	private Long addTime;
	private Set<MemberNotice> memberNotices = new HashSet<MemberNotice>(0);

	// Constructors

	/** default constructor */
	public Notice() {
	}

	/** minimal constructor */
	public Notice(Integer type, String title, String summary, String content, Long addTime) {
		this.type = type;
		this.title = title;
		this.summary = summary;
		this.content = content;
		this.addTime = addTime;
	}

	/** full constructor */
	public Notice(Integer type, String title, String summary, String content, Long addTime,
			Set<MemberNotice> memberNotices) {
		this.type = type;
		this.title = title;
		this.summary = summary;
		this.content = content;
		this.addTime = addTime;
		this.memberNotices = memberNotices;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_NOTICE")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "NOTICE_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getNoticeId() {
		return this.noticeId;
	}

	public void setNoticeId(Long noticeId) {
		this.noticeId = noticeId;
	}

	@Column(name = "TYPE", nullable = false, precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "TITLE", nullable = false, length = 200)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "SUMMARY", nullable = false, length = 400)
	public String getSummary() {
		return this.summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	@Column(name = "CONTENT", nullable = false, length = 4000)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "notice")
	public Set<MemberNotice> getMemberNotices() {
		return this.memberNotices;
	}

	public void setMemberNotices(Set<MemberNotice> memberNotices) {
		this.memberNotices = memberNotices;
	}

}